package com.troila.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(
        prefix = "config"
)
@Data
public class RpcConfig {

    private final RpcServerProperties rpc = new RpcServerProperties();

    @Data
    public static class RpcServerProperties {

        private int port = 2029;
        // 默认30秒 单位秒
        private long keepAliveTime = 30;
        // 默认20秒 单位秒
        private long keepAliveTimeout = 20;
        private boolean permitKeepAliveWithoutCalls = true;
        // 默认一个小时
        private long maxClientIdleTimeout = 1000 * 60 * 60L;

    }

}
